A. Field of the Invention
The present invention relates to an image-quality test for an optical scanner. More particularly, the present invention relates to a method for automatically detecting the occurrence of missing lines on an image generated by an optical scanner, thereby detecting the internal problems of the optical scanner.
B. Description of the Prior Art
The image quality of an optical scanner may be influenced by hardware and software problems. Various tests are designed to determine the source of the problems. One test is especially directed to the occurrence of missing lines. Missing lines occur under several circumstances. For instance, as the optical module is driven by an unstable step motor, which cannot drive the transmission system in a constant speed, the scanner may generate discontinuous images. Missing lines also occur when the control system has malfunctions. They also happen when the transmission system and the image sensor are driven at different speeds. Consequently, from the occurrence of the missing lines, possible internal problems of the optical scanner may be predicted. For example, if the number of missing lines for each image scanned is the same, the problem may be very likely caused by the controlling software. On the other hand, if the missing lines always occur at the same places for each image scanned, the problem may be either caused by the motor or the transmission system.
Conventional method for detecting the occurrence of missing lines depends on eye inspection. First, a calibration paper having patterns of slanting line segments thereon for the scanner to read is used. Then, from the image generated, the number of missing lines and identify the locations where the missing lines occurred are counted. The inspectors have to scale up the image to a proper proportion and then determine the location of the missing lines from the pattern of the staircase along two sides of the slanting line segments. For instance, if a single line is missed, the pattern of the staircase will lose one stair. If there are two missing lines, the pattern of the staircase will lose two stairs and so on. If the total number of missing lines is within an allowable range, the image quality of the scanner is qualified. If not, the scanner is not qualified and must be repaired.
The conventional eye inspection method for detecting the occurrence of missing lines is labor demanding especially for images of high resolution. Moreover, to ensure that the image sensor of the optical scanner is well controlled, a document usually has to be repeatedly scanned. Furthermore, eye inspection is not reliable. It is slow in speed, high in error rates and is inconsistent in judgement from time to time. Consequently, the image quality of the optical scanner cannot be guaranteed.
Accordingly, the object of the present invention is to provide an efficient method for detecting the occurrence of missing lines on images generated by an optical scanner, thereby determining the image quality of the optical scanner.
It is another object of the present invention to provide a method that is applicable to all kinds of scanners for automatically detecting the image qualities, thereby replacing eye inspection and increasing the speed and accuracy of the quality test.
It is a further object of the present invention to provide an automatic method for predicting possible internal problems of an optical scanner from the occurrence of missing lines.
These and other objects of the invention, which will become apparent as the invention is described more fully below, are obtained by providing an improved method for automatically detecting the occurrence of missing lines. The method consists of the following steps: First, the slanting line segment on a calibration paper is read. Then, the median value of the predetermined highest gray levels and set a fault tolerance value are calculated. The first row of the slanting line segment is searched to find the pixel with gray levels closest to the median value. After finding the pixel, the pixel is denoted as (Xi,Yj) where i,j are equal to 1. The pixel on (Xi,Yj) is allowed to be the starting pixel for gray-level comparison.
Then, the gray levels of the pixels located on (Xi,Yj) and (Xixe2x88x921,Yj+1) is compared. If the gray-level difference between these two pixels is larger than the fault tolerance value, the occurrence of a missing line is determined. The number of missing lines is then incremented by one. To determine the total number of missing lines on that row, the gray levels of the pixels located on (Xi,Yj), (Xixe2x88x921,Yj+1), and (Xixe2x88x922,Yj+1) such that (Xi,Yj) less than (Xixe2x88x921,Yj+1) and (Xi,Yj) greater than (Xixe2x88x922,Yj+1) are checked. If they are not correspondent to the comparison condition, the shift index k will be incremented by one repeatedly until the gray-level difference is correspondent to a predetermined condition.
However, if the gray-level difference between the pixel on (Xi,Yj) and (Xixe2x88x921,Yj+1) is smaller than the fault tolerance value, then this indicates that there is no occurrence of missing line on that row. The comparison can directly move on to the next row. During the comparison process, the number of missing lines will be incremented and the places where missing lines occurred will be marked. After the entire image has been checked, the total number of missing lines will be displayed with marks indicating the location of the missing lines. If the total number of missing lines is within an allowable range, the image quality of the optical scanner is qualified. Otherwise, the optical scanner is not qualified.